home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.4 Applications 1997 August / SGI IRIX 6.4 Applications 1997 August.iso / dist / mmailp.idb / usr / lib / Zmail / bin / shownonascii.z / shownonascii
Encoding:
Text File  |  1997-01-22  |  1.7 KB  |  65 lines

  1. #!/bin/csh -fb
  2. # (The "-fb" might need to be changed to "-f" on some systems)
  3. #
  4. set MYFONTDIR=/tmp_mnt/hosts/zeppelin/builds/auto/irix62/metamail/fonts
  5.  
  6. set CHARSET="$1"
  7. shift
  8. if ("$1" == "-e") then
  9.     shift
  10.     set CMD=($*:q)
  11.     set RIGHTTERMCMD=($*:q)
  12. else
  13.     set CMD=(more $*:q /dev/null)
  14.     set RIGHTTERMCMD=(more $*:q)
  15. endif
  16. if ($?MM_CHARSET) then
  17.     if ($MM_CHARSET == "$CHARSET") then
  18.     $RIGHTTERMCMD:q
  19.     exit
  20.     endif
  21. endif
  22. if ($?MM_AUXCHARSETS) then
  23.     if ($MM_AUXCHARSETS =~ *${CHARSET}*) then
  24.     $RIGHTTERMCMD:q
  25.     exit
  26.     endif
  27. endif
  28. if (! -d $MYFONTDIR) then
  29.     echo This message contains non-ASCII text, but the $CHARSET font
  30.     echo has apparently not yet been installed on this machine.  
  31.     echo "(There is no directory named ${MYFONTDIR}.)"
  32.     echo "What follows may be partially unreadable, but the English (ASCII) parts"
  33.     echo "should still be readable."
  34.     echo ""
  35.     cat $*:q
  36.     exit 0
  37. endif
  38.  
  39. if (! $?DISPLAY) then
  40.     echo This message contains non-ASCII text, which can only be displayed
  41.     echo properly if you are running X11.  What follows
  42.     echo "may be partially unreadable, but the English (ASCII) parts"
  43.     echo "should still be readable."
  44.     cat $*:q
  45.     exit 0
  46. endif
  47. set FPGREP=`xset q | grep $MYFONTDIR`
  48. if ("$FPGREP" == "") then
  49.     echo Adding $MYFONTDIR to your font path.
  50.     xset +fp $MYFONTDIR
  51. else
  52.     echo Your font path appears to be correctly set.
  53. endif
  54. echo Running xterm to display text in $CHARSET, please wait...
  55. unsetenv MM_NOTTTY
  56.  
  57. # The following line might work better on IBM RT and other machines that 
  58. #      think it smart inhibit 8 bit chars in xterms.
  59. # xterm -fn $CHARSET -tm litout -e $CMD
  60. set XCHARSET=\*`echo $CHARSET | sed -e s/iso-/iso/`
  61. xterm -fn "$XCHARSET" -e $CMD:q
  62.  
  63.  
  64.  
  65.